package top.lingkang.securityoauth2.client.http.impl;

import cn.hutool.http.HttpRequest;
import top.lingkang.securityoauth2.client.http.FinalHttpRequest;

import java.util.HashMap;

/**
 * @author lingkang
 * Created by 2022/7/1
 */
public class DefaultFinalHttpRequest implements FinalHttpRequest {

    @Override
    public String get(String url, HashMap<String, String> header) {
        return HttpRequest.get(url).headerMap(header, true).execute().body();
    }

    @Override
    public String post(String url, HashMap<String, Object> param, HashMap<String, String> header) {
        return HttpRequest.get(url).form(param).headerMap(header, true).execute().body();
    }
}
